package com.archermind.style.pojo;

import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileNotFoundException;

public class Constants {

    /** 附件上传大小限制10M */
    public static final long ATTACHMENT_MAXSIZE = 10240000;
    /**附件存放路径*/
    public static final String ATTACHMENT_UPLOAD_PATH ="/images/attachment/";

    /**上传样式打包存放路径*/
    public static final String RELEASE_PATH ="/images/release/";

    /**发布后返回zip包路径*/
    public static final String MAPCONFIG_PATH ="/images/mapConfig/";

    public static final File webRoot = getAbsWebRoot();


    private static File getAbsWebRoot()  {
        File path = null;
        try {
            path = new File(ResourceUtils.getURL("classpath:").getPath()+"/static");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        if(!path.exists()) path = new File("static");
        System.out.println("path:"+path.getAbsolutePath());
        return path;
    }
}
